#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int a = 0;
	int sn = 0;
	scanf("%d", &a);
	sn = a + (10 * a + a) + (100 * a + 10 * a + a) + (1000 * a + 100 * a + 10 * a + a) + (10000 * a + 1000 * a + 100 * +10 * a + a);
	printf("%d",sn);
	return 0;
}